//
//  NSData+Extension.m
//  DGGCommonSDK
//
//  Created by dgg_hzk on 2019/11/20.
//

#import "NSData+Extension.h"

@implementation NSData (Extension)

- (NSString *)base64String{
    if(self){
        return [self base64EncodedStringWithOptions:(NSDataBase64Encoding64CharacterLineLength)];
    }
    return nil;
}

- (NSString *)decodeBaseString{
    if(self){
        NSData *baseData = [[NSData alloc] initWithBase64EncodedData:self options:(NSDataBase64DecodingIgnoreUnknownCharacters)];
        return [[NSString alloc] initWithData:baseData encoding:NSUTF8StringEncoding];
    }
    return nil;
}

@end
